package ssx.demo.springbootmysqlcurd.dao;

import org.apache.ibatis.annotations.*;
import ssx.demo.springbootmysqlcurd.entity.UserPOJO;

import java.util.List;
import java.util.Map;

/**
 * mysql数据库下ssx库下的表 scd-202002-user
 */
@Mapper
public interface IDao {
    String tabName="`scd-202002-user`";

    @Insert("insert into "+  tabName +"(name) values(#{name}) ")
    boolean addUser(UserPOJO userPOJO);

    @Update("update "+  tabName +" set name=#{name} where id=#{id} ")
    boolean modifyUser(UserPOJO userPOJO);

    @Delete("delete from "+  tabName +" where  id=#{id} ")
    boolean removeUser(UserPOJO userPOJO);

    @Select("select * from  "+  tabName + "  where  id=#{id} ")
    UserPOJO queryUser(UserPOJO userPOJO);

    //此方法实现于mapper配置文件
    List<UserPOJO> queryAll();

}
